<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<html>
<head>
<script src="${CTX}/static/plugins/ueditor/ueditor.config.js"></script>
<script src="${CTX}/static/plugins/ueditor/ueditor.all.min.js"></script>
<script src="${CTX}/static/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<title></title>
</head>
<body>
	<div id="tb" class="toolbar">
		<div style="float: left;">
			<shiro:hasPermission name="home:save">
				<a id="save" class="form-btn success">
					<i class="fa fa-save m-r-5"></i>保存
				</a>
			</shiro:hasPermission>
		</div>
		<div style="float: right;">
			<a id="find" class="form-btn success">
				<i class="fa fa-refresh m-r-5"></i>刷新
			</a>
		</div>
		<div style="clear: both;"></div>
	</div>
	<div class="easyui-panel" data-options="fit:true,border:false,header:'#tb'" style="padding: 3px;">
		<script id="editor" type="text/plain">${content}</script>
	</div>
</body>
<script>
	$(function() {
		var ue = UE.getEditor('editor', {
			initialFrameWidth : -1,
			initialFrameHeight : 1000
		});
		$('#find').click(function() {
			window.location.reload();
		});
		$('#save').click(function() {
			$.mask();
			$.ajax({
				url : '${CTX}/mgt/sys/home/save',
				data : {
					content : UE.getEditor('editor').getContent()
				},
				success : function(data) {
					$.unmask();
					$.handle(data);
				}
			});
		});
	});
</script>
</html>